package com.dzt.androidframework.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.dzt.androidframework.R;
import com.dzt.androidframework.bean.MenuBean;

import org.xutils.view.annotation.ViewInject;
import org.xutils.x;

import java.util.List;

/**
 * Created by M02323 on 2017/3/28.
 */

public class FunctionAdapter extends AbsListAdapter<String> {

	public FunctionAdapter(Context context, List<String> datas) {
		super(context, datas);
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder holder;
		if (convertView == null) {
			holder = new ViewHolder();
			convertView = layoutInflater.inflate(android.R.layout.simple_list_item_1, parent, false);
			x.view().inject(holder, convertView);
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}
		holder.tvName.setText(datas.get(position));
		return convertView;
	}

	class ViewHolder {
		@ViewInject(android.R.id.text1)
		TextView tvName;
	}
}
